package com.halfsword.creativecraft.item;

import com.halfsword.creativecraft.CreativeCraft;
import com.halfsword.creativecraft.block.BlockLoader;
import com.halfsword.creativecraft.entity.Entities;
import com.halfsword.creativecraft.item.custom.*;
import com.halfsword.creativecraft.item.custom.ArmorMaterials;
import com.halfsword.creativecraft.sound.Sounds;
import net.minecraft.world.item.*;
import net.minecraftforge.common.ForgeSpawnEggItem;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;

public class ItemLoader {
    public static final DeferredRegister<Item> ITEMS =
            DeferredRegister.create(ForgeRegistries.ITEMS, CreativeCraft.MOD_ID);
    public static final RegistryObject<Item> GEMSPACE = ITEMS.register("gemspace",()-> new Item(new Item.Properties()));
    public static final RegistryObject<Item> RAWSPACE = ITEMS.register("rawspace",()-> new Item(new Item.Properties()));
    public static final RegistryObject<Item> LINKAGE_I = ITEMS.register("linkage_lv1",()-> new Item(new Item.Properties()));
    public static final RegistryObject<Item> CYLINDER_I = ITEMS.register("cylinder_lv1",()-> new Item(new Item.Properties()));
    public static final RegistryObject<Item> PISTON_I = ITEMS.register("piston_lv1",()-> new Item(new Item.Properties()));
    public static final RegistryObject<Item> AXIS_I = ITEMS.register("axis_lv1",()-> new Item(new Item.Properties()));
    public static final RegistryObject<Item> SMALL_GEAR_IRON = ITEMS.register("small_gear_iron",()-> new Item(new Item.Properties()));

    public static final RegistryObject<Item> INGOT_TITANIUM = ITEMS.register("ingot_titanium",()-> new Item(new Item.Properties()));
    public static final RegistryObject<Item> STAFFSPACE = ITEMS.register("space_staff",()-> new SpaceModeTurn(new Item.Properties().stacksTo(1)));
    public static final RegistryObject<Item> FUELSPACE = ITEMS.register("fuelspace",()-> new SpaceFuelItem(new Item.Properties(),1000));

    public static final RegistryObject<Item> SWORDSPACE = ITEMS.register("space_sword",()-> new SwordItem(ToolTiers.SPACE ,50,2,  new Item.Properties()));
    public static final RegistryObject<Item> PICKAXESPACE = ITEMS.register("space_pickaxe",()-> new PickaxeItem(ToolTiers.SPACE ,50,2,  new Item.Properties()));
    public static final RegistryObject<Item> AXESPACE = ITEMS.register("space_axe",()-> new AxeItem(ToolTiers.SPACE ,50,2,  new Item.Properties()));
    public static final RegistryObject<Item> SHOVELSPACE = ITEMS.register("space_shovel",()-> new ShovelItem(ToolTiers.SPACE ,50,2,  new Item.Properties()));
    public static final RegistryObject<Item> HOESPACE = ITEMS.register("space_hoe",()-> new HoeItem(ToolTiers.SPACE ,50,2,  new Item.Properties()));

    public static final RegistryObject<Item> HELMETSPACE = ITEMS.register("space_helmet",()-> new ArmorItems(ArmorMaterials.SPACE,ArmorItem.Type.HELMET , new Item.Properties()));
    public static final RegistryObject<Item> CHESTPLATESPACE = ITEMS.register("space_chestplate",()-> new ArmorItems(ArmorMaterials.SPACE,ArmorItem.Type.CHESTPLATE , new Item.Properties()));
    public static final RegistryObject<Item> LEGGINGSSPACE = ITEMS.register("space_leggings",()-> new ArmorItems(ArmorMaterials.SPACE,ArmorItem.Type.LEGGINGS , new Item.Properties()));
    public static final RegistryObject<Item> BOOTSSPACE = ITEMS.register("space_boots",()-> new ArmorItems(ArmorMaterials.SPACE,ArmorItem.Type.BOOTS , new Item.Properties()));

    public static final RegistryObject<Item> HELMETENDER = ITEMS.register("ender_helmet",()-> new ArmorItems(ArmorMaterials.ENDER,ArmorItem.Type.HELMET , new Item.Properties()));
    public static final RegistryObject<Item> CHESTPLATEENDER = ITEMS.register("ender_chestplate",()-> new ArmorItems(ArmorMaterials.ENDER,ArmorItem.Type.CHESTPLATE , new Item.Properties()));
    public static final RegistryObject<Item> LEGGINGSENDER = ITEMS.register("ender_leggings",()-> new ArmorItems(ArmorMaterials.ENDER,ArmorItem.Type.LEGGINGS , new Item.Properties()));
    public static final RegistryObject<Item> BOOTSENDER = ITEMS.register("ender_boots",()-> new ArmorItems(ArmorMaterials.ENDER,ArmorItem.Type.BOOTS , new Item.Properties()));

    public static final RegistryObject<Item> SPACEDECECTOR = ITEMS.register("space_detector",()-> new SpaceDetectorItem(new Item.Properties().durability(499)));


    public static final RegistryObject<Item> CORNFIELD_CHASE_DISC = ITEMS.register("cornfield_chase_disc",()-> new RecordItem(6, Sounds.CORNFIELD_CHASE,new Item.Properties().rarity(Rarity.EPIC).stacksTo(1),2480));
    public static final RegistryObject<Item> NOTHING_SPAWN_EGG = ITEMS.register("nothing_spawn_egg",()->new ForgeSpawnEggItem(Entities.NOTHING,0x4e4e4e,0x33ffff,new Item.Properties().rarity(Rarity.UNCOMMON)));

    public static final RegistryObject<Item> BLUEBERRY_SEEDS = ITEMS.register("blueberry_seeds",()-> new ItemNameBlockItem(BlockLoader.BLUEBERRY_CROP.get(),new Item.Properties()));
    public static final RegistryObject<Item> BLUEBERRY = ITEMS.register("blueberry",()-> new Item(new Item.Properties().food(FoodItem.BLUEBERRY)));


    public static final RegistryObject<Item> SORGHUM_SEEDS = ITEMS.register("sorghum_seeds",()-> new ItemNameBlockItem(BlockLoader.SORGHUM_CROP.get(),new Item.Properties()));
    public static final RegistryObject<Item> SORGHUM = ITEMS.register("sorghum",()-> new Item(new Item.Properties()));
    public static void register(IEventBus eventBus) {
        ITEMS.register(eventBus);
    }

}

